Video signal coding method and video signal encoder

ABSTRACT

An input video signal is coded by a 1-pass type coding system highly efficiently by taking the proportions of the components of the input image. The coding difficulty level computation circuit  33  determines the coding difficulty level d of the input moving image signal S 1  and sends it to the amount of allocated bits computation circuit/controller  34 . The amount of allocated bits computation circuit/controller  34  determines a reference value of amount of allocated coding bits on the basis of the coding difficulty level d and, when shifting the reference value to the actual amount of allocated coding bits b_x, it stores part of the sum of the amounts of allocated bits a per unit time for a certain period of time as virtual buffer in advance and the actual reference value of the amount of allocated coding bits is obtained by dividing the sum of the amounts of allocated coding bits per unit time less the part stored as virtual buffer by said period of time. As long as the virtual buffer is positive, the provision of an amount of bits exceeding said reference value is permitted.

BACKGROUND OF THE INVENTION

1. Field of the Invention

This invention relates to a video signal coding method and a videosignal encoder that can highly efficiently and effectively encodedigital signals at the transmission side. More particularly, the presentinvention relates to a video signal coding method and a video signalencoder adapted to control a coding operation conducted at a variablebit rate on a single path when coding moving picture signals.

2. Description of the Related Art

Since digital video signals involve a large amount of data, the use of ahigh efficiency coding means that can encode a digital video signal at ahigh compression ratio is indispensable particularly when recordingsignals on a small recording medium having a small storage capacity.High efficiency coding methods utilizing the correlation of videosignals have been proposed as solutions for meeting the need. One ofsuch solutions is the use of the MPEG system. The MPEG (Moving PictureImage Coding Experts Group) system was proposed as standard system as aresult of the discussion in ISO-IEC/JTC1/SC2/WG11. It is a hybrid systemrealized by combining motion compensation predictive coding and discretecosine transform (DCT). With the MPEG system, firmly the redundancy iseliminated on the time base by determining the inter-frame differencesof video signals and subsequently on the space base by means of discretecosine transform to efficiently encode video signals.

Generally, video signals do not remain invariable and the amount ofinformation of each picture changes with time. Thus, it is known that ahigh image quality can be realized by means of variable bit rate codingrather than by means of constant bit rate coding if a same amount ofcodes is used.

For example, 2-pass type variable bit rate coding is generally used forvideo signals to be recorded on a DVD-video. The 2-pass type involvestwo coding operations including one for determining the amount of codesand one to be conducted by variably controlling the bit rate on thebasis of the determined amount of codes. While this technique providesthe advantage of effectively exploiting the total amount of coding bitsthat can be used, it is accompanied by the disadvantage that a timeperiod more than twice of the duration of the moving picture sequence isrequired for the processing operation so that this technique is notsuited to real time processing operations.

The specifications and the drawings of Japanese Patent ApplicationsLaid-Open Nos. 7-311418 and 9-113141 disclose a 1-pass type variable bitrate coding method in an attempt for reducing the processing time.

FIG. 1 of the accompanying drawings schematically illustrates theconfiguration of an encoder for moving pictures realized by applying theknown 1 -pass type variable bit rate coding method and FIG. 2 sows aflow chart of the processing operation using the 1-pass type variablebit rate coding method.

Referring to FIG. 1 showing a block diagram of a known moving pictureencoder, the input moving image signal applied to input terminal 200 issent to coding difficulty level computation circuit 201 and delaycircuit 203. Then, the output of the coding difficulty level computationcircuit 201 is sent to amount of allocated bits computation circuit 202that is adapted to compute the amount of allocated bits per unit timeand the output of the amount of allocated bits computation circuit 202is sent to moving image coding circuit 204. The moving image codingcircuit 204 encodes the output signal of the delay circuit 203 as afunction of the amount of allocated bits as output from the amount ofallocated bits computation circuit 202 and outputs the coded signal ascoded bit stream from terminal 205.

Now, the operation of the moving picture encoder of FIG. 1 will bedescribed by referring to the flow chart of FIG. 2.

Referring to FIG. 2, in Step S401, the moving picture signal fed to theterminal 200 is input to the coding difficulty level computation circuit201 to determine the coding difficulty level d of the input image perunit time, which unit time may typically be 0.5 seconds. The computingoperation of the coding difficulty level computation circuit 201 istypically performed by encoding the input moving picture, fixing thequantization step, and computing the amount of generated codes in apredetermined period of time.

Then, in Step S402, the amount of allocated bits computation circuit 202computationally determines the amount of allocated bits b relative tothe coding difficulty level d obtained by the coding difficulty levelcomputation circuit 201. For this operation, the relationship betweenthe coding difficulty level d and the amount of allocated bits bobservable when a reference moving image sequence is subjected tovariable bit rate coding at a predetermined average bit rate is obtainedin advance for each unit time. The amount of allocated bits per unittime for the reference moving image sequence is held to less than thestorage capacity of the recording medium to be used for signalrecording. FIG. 3 shows a graph that illustrates the relationshipbetween the coding difficulty level d and the amount of allocated bitsb.

Referring to FIG. 3, the horizontal axis of the graph represents thecoding difficulty level d and the vertical axis of the graph representsthe probability of appearance h (d) of coding difficulty level d in thereference moving image sequence. The amount of allocated bits for anygiven coding difficulty level is computed on the basis of function b(d). This function is empirically obtained on a trial and error basis byconducting a number of experiments of encoding many moving imagesequences (e.g., movies) at a predetermined average bit rate andevaluating the image quality of each sequence. In other words, itrepresents a generic relationship applicable to any moving imagesequences that may be observable in this world. The specification andthe drawings of Japanese Patent Application Laid-Open No. 7-311418discloses a method of obtaining such a function. Thus, the amount ofallocated bits computation circuit 202 determines the amount ofallocated bits b for the coding difficulty level d per unit time of theimage that is input through the terminal 200 on the basis of therelationship as illustrated in FIG. 3.

Since the processing operation of the coding difficulty levelcomputation circuit 201 and the amount of allocated bits computationcircuit 202 on the input image of a unit time length completes withinthe unit time, the delay circuit 203 is provided in the 1-pass typemoving picture encoder to delay the input of the image signal to themoving image coding circuit 204 by a unit time.

Then, in Step S40, the moving image coding circuit 204 encodes the inputmoving image of each unit time so as to show the amount of allocatedbits as given by the amount of allocated bits computation circuit 202for the moving image. In other words, the moving image coding circuit204 encodes the input moving image of each unit time, using thequantization step size that is defined on the basis of the amount ofallocated bits.

With such a 1-pass type method, it is possible to perform an operationof variable bit rate coding on the input video signal with an optimalamount of allocated bits that corresponds to the coding difficulty levelof the signal substantially on a real time basis.

Meanwhile, although the relationship of FIG. 3 is applicable to almostall moving image sequences, it is not to certain special sequences wherethe total amount of bits generated by the moving image coding circuit204 exceeds the total amount of available bits so that the moving imagesequence cannot be recorded on the intended recording medium.

The conventional 2-pass type method cannot be used for encoding a movingimage sequence having a predetermined time length at a variable bit rateon a real time basis and recording it in a recording medium having acertain level of storage capacity. On the other hand, while theconventional 1-pass type method can encode almost all moving imagesequences at a variable bit rate on a real time basis and store asequence having a predetermined time length in a recording medium havinga certain level of storage capacity, it is not applicable to certainspecial sequences where the total amount of coded bits exceeds the totalamount of available bits so that the sequence having a predeterminedtime length cannot be recorded on a recording medium.

In view of this problem, there has been proposed a technique ofguaranteeing that a signal having a predetermined time length can berecorded on a recording medium having a certain level of storagecapacity by controlling the amount of actually allocated bits in such away that the sum of the bits generated when a signal having a timelength good for recording on a recording medium is encoded is less thanthe amount of bits that can be used for recording the signal on therecording medium.

More specifically, assuming that the input signal of each unit time isencoded with a predetermined amount of allocated bits b_av, the sum ofthe amounts of allocated bits B_av down to the current time and the sumof the amounts of actually generated coding bits B_gene down to thecurrent time are compared and if the value (B_av−B_gene) is positive, itis permitted to give an amount of allocated bits more than b_av for theguarantee.

The predetermined amount of allocated bits b_av per unit time isdetermined by the formula below;b _(—) av=T_unit time×B _(—) V/T _(—) SEQwhere B_V:the amount of bits available to recording the moving image inthe signal recording medium,

-   -   T_SE:the time length of a moving image sequence that can be        recorded in the signal recording medium, and    -   T_unit time:unit time length.

The input signal is pre-filtered on the basis of the informationobtained when shifting the reference value of the amount of allocatedcoding bits to the actual value of the amount of allocated coding bitsand then the obtained signal is coded to make the degradation of thesignal due to the coding less conspicuous. More specifically, when theactual value of the amount of allocated coding bits is made smaller thanthe reference value of the amount of allocated coding bits, thedegradation of the signal due to the coding less conspicuous by causingthe input image to pass through a low pass filter.

When the operation of coding a signal and recording the coded signal ona recording medium is divided into segments of operation that are to becarried out sequentially, the above (B_av−B_gene) or a correspondingvalue is stored in the recording medium. Thus, when the signal is storedin a vacant storage area of the recording medium, the above(B_av−B_gene) or the corresponding value is read out from recordingmedium and the amount of bits allocated per unit time to the signal iscomputed on the basis of the read out value so that the storage capacityof the recording medium can be utilized effectively and efficiently.

When the input signal is that of a moving image, the coding difficultylevel is determined on the basis of the information on the imagecharacteristics of the input image for every predetermined period oftime and the signal is coded on the basis of the amount of allocatedcoding bits that reflects the visual characteristics of human being,using the information on the image characteristics.

FIG. 4 shows a block diagram of an encoder for moving pictures realizedby applying a 1-pass type variable bit rate coding method thatguarantees that a signal having a predetermined length on a recordingmedium having a certain level of storage capacity.

Referring to FIG. 4, the moving image signal S1 input to terminal 101 issent to a motion vector computation circuit 102. The motion vectorcomputation circuit 102 outputs information on the motion vector (themotion vector and the prediction error) of the input moving image. Themoving image signal and the motion vector information are then input toa coding difficulty level computation circuit 103. The coding difficultylevel computation circuit 103 computes the coding difficulty level d perunit time of the input moving image S1. The obtained coding difficultylevel d is then input to the amount of allocated bits computationcircuit 104 that computes the amount of allocated bits per unit time.More specifically, the amount of allocated bits computation circuit 104computes reference value b of the amount of bits allocated per unit timefor coding the input image. The reference value b of the amount ofallocated bits is then input to a controller 105. The controller 105shifts the reference value b of the amount of allocated bits to theactual value b_x of the amount of allocated bits and outputs it. Thecontroller 105 also outputs information S4 on the processing operationof a pre-filter 107. A Delay circuit 106 delays the input of the inputmoving image signal S1 having the length of the unit time to thepre-filter 107 by the unit time, or until the processing operation ofthe amount of allocated bits computation circuit 104 and that of thecontroller 105 are completed. The input moving image signal S2 delayedby the delay circuit 106 is processed by the pre-filter 107 according tothe processing information S4 and the pre-filter 107 outputs theprocessed signal S3. The pre-filter 107 is adapted to change itsfiltering characteristics according to the processing information S4 soas to prevent the possible degradation of the input moving image signalat the time of coding by causing the signal to pass through a low passfilter when the input moving image is a complex one and requires a largeamount of bits allocated to it per unit time. Moving image codingcircuit 108 encodes the processed image signal S3 so as to make it showthe amount of allocated bits b_x per unit time. The moving image codingcircuit 108 then outputs coded bit stream S5 and the amount of generatedbits b_gene per unit time, of which the coded bit stream S5 is outputfrom terminal 109.

With such a 1-path type method, the actual value of the amount ofallocated bits can be controlled in such a way that input moving imagecan be coded at a variable bit rate by using an optimal amount ofallocated bits according to the coding difficulty level of the signal ona real time bases and the total sum of the amounts of generated bitsobtained when coding the signal having a time length that allows thesignal to be recorded on the recording medium is less than the amount ofbits available for recording the signal on the recording medium.

However, the above described method for determining the amount ofallocated bits according to the coding difficulty level is accompaniedby a problem that, when the input moving image signal shows a highcoding difficulty level concentrative in the initial stages,(B_av−B_gene) would not show a positive value and hence it is notpossible to improve the image quality because a sufficient amount ofbits cannot be allocated per unit time for the part of the image signalshowing a high initial coding difficulty level if a latter part of theimage signal shows a low coding difficulty level.

Additionally, there is another problem that accompanies the abovemethod. When (B_av−B_gene) becomes positive so that it is possible toallocate an amount of bits per unit time that is greater than theordinary level and the input moving image signal continuously shows ahigh coding difficulty level so that an amount of bits per unit timethat is greater than the ordinary level is actually allocated butsubsequently (B_av−B_gene) suddenly becomes negative on the way, theamount of allocated bits per unit time falls abruptly.

On the other hand, when the input moving image signal continuously showsa low coding difficulty level, there also arises a problem that theallocation of an amount of bits per unit time that is smaller than theordinary level goes on to degrade the quality of the recorded image to alevel lower than the image quality that is obtained when the image iscoded at a fixed coding rate, although (B_av−B_gene) is positive and theamount of bits per that is allocated per unit time is greater than theordinary level.

Additionally, there is also a problem that, since the maximum amount ofallocated bits and the minimum amount of allocated bits are not definedin actual operations, there can occur parts where the amount ofallocated bits is extremely large and parts where the amount ofallocated bits is extremely small after the coding operation and henceit is not possible to allocate bits to the input image in a wellcoordinated manner.

Finally, although the image quality of an image can appear to bedegraded in some parts to the visual sense of human being while it doesnot in some other parts if bits are allocated at a same rate, nosatisfactory measures have been taken to such a problem.

SUMMARY OF THE INVENTION

In view of the above identified circumstances, it is therefore theobject of the present invention to provide a video signal coding methodand a video signal encoder that can allocate bits adequately and followany changes in the coding difficulty level so that the input videosignal can be coded effectively and efficiently even the input videosignal concentrative shows a high coding difficulty level in the initialstages, when it is possible to allocate bits at a rate higher than theordinary rate and the input video signal continuously shows a highcoding difficulty level and when the input video signal continuouslyshows a low coding difficulty level.

In an aspect of the invention, the above object is achieved by providinga video signal coding method comprising:

a step of determining the coding difficulty level d of an input videosignal for each unit time;

a step of determining a reference value for allocating coding bits onthe basis of function b (d) for the amount of coding bits b allocatedfor each unit time and related in advance to the coding difficulty leveld of said input video signal for each unit time;

a step of determining the actual amount of allocated coding bits b_x onthe basis of the reference value; and

a step of generating coded data by coding the input video signal foreach unit time on the basis of said actual amount of allocated codingbits b_x.

When obtaining the actual amount of allocated coding bits on the basisof the above reference value in order to shift the reference value ofthe amount of allocated coding bits to the actual value of the amount ofallocated coding bits, part of the sum of the amounts of allocatedcoding bits per unit time is stored as virtual buffer for a certainperiod of time in advance and the actual reference value of the amountof allocated coding bits is determined by dividing the sum of theamounts of allocated coding bits per unit time less the part stored asvirtual buffer by said certain period of time. As a result, it ispossible to allocate bits at a rate higher than the reference value ofthe amount of allocated bits per unit time if the input moving imagesignal continually shows a high coding difficulty level in the initialstates of the coding operation that lasts for said certain period oftime.

More specifically, when shifting the reference value of the amount ofallocated coding bits to the actual value of the amount of allocatedcoding bits, part of the sum B_av of the amounts of allocated bits b_avper unit time for a certain period of time T_vbr, orB _(—) av=b _(—) av×T _(—) vbr,is stored as virtual buffer V_vbr in advance and the actual referencevalue of the amount of allocated coding bits b_real is obtained byb_real (B _(—) av−V _(—) vbr)/T _(—) vbrso that an amount of allocated bits not smaller than b_real is given aslong as V_vbr>0 but an amount smaller than b_real is given otherwise.

As a result, when the coding operation is controlled on the basis of avariable bit rate, it can be guaranteed that the sum of the generatedbits for said certain period of time T_vbr is less than B_av.

When correlating the coding difficulty level of the input image with theamount of allocated bits per unit time, the reference value isdetermined by taking the relationship of the coding difficulty level,the amount of allocated coding bits and the amount of actually generatedbits of a preceding unit time and also the relationship of the codingdifficulty level of the preceding unit time and that of the current unittime. As a result, the amount of allocated bits is determined by takingthe coding difficulty level and the amount of allocated bits of thepreceding time unit into consideration when the input video signalcontinuously shows a high coding difficulty level or a low codingdifficulty level for some time so that a situation where the amount ofallocated bits abruptly falls on the way. Additionally, if possible, alarge amount of bits may be allocated when the coding difficulty levelof the input video signal is low.

Still additionally, according to the invention, when bits are allocatedper unit time by an amount greater than or smaller than the referencevalue, it is possible allocate bits in a well coordinated manner bydefining in advance an upper limit and a lower limit for the amount ofallocated bits per unit time as a function of the reference value. Then,a situation where an extremely large or small amount of bits areallocated locally can be effectively avoided.

Furthermore, when an amount of bits less than the reference value isallocated because the coding difficulty level is low, a lower limit maybe defined as a function of the ratio of the parts where degradation dueto coding is conspicuous in order to prevent a coding operation thatremarkably degrade the image quality from occurring by taking the visualcharacteristics of the input video signal into consideration.

As pointed out above, according to the invention, when a reference value(for the amount of allocated coding bits) is determined on the basis ofthe amount of allocated coding bits obtained from the relationship withthe coding difficulty level and the amount of actually allocated codingbits is determined on the basis of the reference, part of the sum of theamounts of allocated coding bits per unit time is stored as virtualbuffer for a certain period of time in advance and the actual referencevalue of the amount of allocated coding bits is determined by dividingthe sum of the amounts of allocated coding bits per unit time less thepart stored as virtual buffer by said certain period of time As aresult, it is possible to allocate bits at a rate higher than thereference value of the amount of allocated bits per unit time if theinput moving image signal continually shows a high coding difficultylevel in the initial states of the coding operation that lasts for saidcertain period of time.

When correlating the coding difficulty level of the input image with theamount of allocated bits per unit time, the reference value isdetermined by taking the relationship of the coding difficulty level,the amount of allocated coding bits and the amount of actually generatedbits of a preceding unit time and also the relationship of the codingdifficulty level of the preceding unit time and that of the current unittime into consideration. As a result, the amount of allocated bits isdetermined by taking the coding difficulty level and the amount ofallocated bits of the preceding time unit into consideration when theinput video signal continuously shows a high coding difficulty level ora low coding difficulty level for some time so that a situation wherethe amount of allocated bits abruptly falls on the way. Additionally, ifpossible, a large amount of bits may be allocated when the codingdifficulty level of the input video signal is low.

Furthermore, according to the invention, a lower limit may be defined asa function of the ratio of the parts where degradation due to coding isconspicuous in order to prevent a coding operation that remarkablydegrade the image quality from occurring by taking the visualcharacteristics of the input video signal into consideration.

Thus, according to the invention, it is possible to guarantee that aninput video signal having a predetermined time length is stored in arecording medium having a certain storage capacity to effectivelyutilize the storage capacity of the recording a medium, whilecontrolling the coding operation adaptively using a variable bit rate asa function of the coding difficulty level of the input video signal.BRIEF

DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic block diagram of a known moving image encoderrealized by applying a conventional basic 1-pass type variable bit ratecoding method;

FIG. 2 is a flow chart of the conventional 1-pass type variable bit ratecoding method;

FIG. 3 is a graph of the function b (d) showing the relationship betweenthe probability of appearance h (d) per unit time length of codingdifficulty level d in the reference moving image sequence and the amountof allocated bits for a predetermined average bit rate b.

FIG. 4 is a schematic block diagram of a known moving image encoderrealized by applying a conventional evolutional 1-pass type variable bitrate coding method;

FIG. 5 is a schematic block diagram of an embodiment of moving imageencoder realized by applying a video signal coding method according tothe invention;

FIG. 6 is a flow chart illustrating the algorithm of the amount ofallocated bits per unit time computation circuit and the controller 24of FIG. 5;

FIG. 7 is a flow chart of the operation of correcting the codingdifficulty level in Step S56 of FIG. 6;

FIG. 8 is a flow chart of the operation of visually correcting theamount of allocated bits in Step S58 of FIG. 6;

FIG. 9 is a flow chart of the operation of correcting the amount ofallocated bits in Step S59 of FIG. 6;

FIG. 10 is a flow chart of the operation of correcting the amount ofallocated bits for the absolute coding difficulty level in Step S60 ofFIG. 6;

FIG. 11 is a flow chart of the operation of processing a scene change inStep S62 of FIG. 6;

FIG. 12 is a flow chart of the operation of processing a virtual bufferin Step S63 of FIG. 6;

FIG. 13 is a schematic illustration of the concept of virtual buffer;and

FIG. 14 is schematic block diagram of a signal recording/reproductionapparatus to which an embodiment of encoder according to the inventionis applicable.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

Now, a video signal coding method and a video signal encoder accordingto the invention will be described by referring to the views of theaccompanying drawing that illustrate preferred embodiments of theinvention particularly in terms of encoding a moving image.

FIG. 5 is a schematic block diagram of an embodiment of moving imageencoder realized by applying a video signal coding method according tothe invention.

Referring to FIG. 5, moving image signal S1 input to a terminal 31 issent to a motion vector computation circuit 32, a coding difficultylevel computation circuit 33, a visual characteristics measurementcircuit 35 and a delay circuit 36.

The visual characteristics measurement circuit 35 measures visualcharacteristics of the input moving image signal S1 and sends theobtained information on the visual characteristics R_visual to amount ofallocated bits computation circuit/controller 34. The motion vectorcomputation circuit 32 outputs the information obtained for the motionvector (the motion vector and the prediction error) of the input movingimage. The information on the motion vector is sent to the codingdifficulty level computation circuit 33 along with the moving imagesignal S1.

The coding difficulty level computation circuit 33 computes the codingdifficulty level d for each unit time from the information on the motionvector sent from the motion vector computation circuit 32, theinformation on the amount of generated bits b_gene fed from moving imagecoding circuit 38 which will be described hereinafter, Q scale q_scaleand the deviation of the brightness value activity. The codingdifficulty level d is then input to the amount of allocated bitscomputation circuit/controller 34. While 1 GOP (group of pictures)according to MPEG nay typically be used for the unit time for thepurpose of the invention, the present invention is by no means limitedthereto.

The amount of allocated bits computation circuit/controller 34 computesthe amount of bits to be allocated b_x for each unit time when codingthe input moving image from the coding difficulty level d input to it,the average amount of allocated bits b_av input to it from the terminal30 and the visual characteristics R_visual fed from the visualcharacteristics measurement circuit 35. The obtained amount of allocatedbits b_x is then output to moving image coding circuit 38. The amount ofallocated bits computation circuit/controller 34 also outputs processinginformation S4 to pre-filter 37.

The delay circuit 36 delays the input of the input moving image signalS1 to the pre-filter 37 by a unit time until the processing operationsof the coding difficulty level computation circuit 33 and the amount ofallocated bits computation circuit/controller 34 are completed. Themoving image signal S2 delayed by the delay circuit 36 is then processedby the pre-filter 37 according to the processing information S4, whichthen outputs processing information S3 to the moving image codingcircuit 38.

The moving image coding circuit 38 encodes the processed video signal S3for each unit time in such a way that it shows the above amount ofallocated bits b_x. The moving image coding circuit 38 outputs the codedbit stream S5, the amount of generated bits b_gene for each unit time,the deviation of the brightness value activity and the allocated Q scaleq_scale. The coded bit stream S5 is output from the terminal 39.

With the above arrangement, the coding difficulty level computationcircuit 33 and the amount of allocated bits computationcircuit/controller 34 determines a reference value (e.g., a referencevalue for the amount of allocated coding bits) on the basis of theamount of allocated coding bits obtained from the relationship with thecoding difficulty level and stores in advance part of the sum of theamounts of allocated bits per unit time for a certain period of time asvirtual buffer so that the actual reference value of the amount ofallocated coding bits is determined by dividing the sum of the amountsof allocated coding bits per unit time less the part stored as virtualbuffer by said certain period of time.

More specifically, when determining the reference value for the amountof allocated coding bits relative to the coding difficulty level d ofeach unit time and shifting the reference value of the amount ofallocated coding bits to the actual value of the amount of allocatedcoding bits b_s , part of the sum B_av of the amounts of allocated bitsb_av per unit time for a certain period of time T_vbr, orB _(—) av=b _(—) av×T _(—) vbr,is stored as virtual buffer V_vbr in advance and the actual referencevalue of the amount of allocated coding bits b_real is obtained byb_real=(B _(—) av−V _(—) vbr)/T _(—) vbrso that an amount of allocated bits not smaller than b_real is given aslong as V_vbr>0 but an amount smaller than b_real is given otherwise.While the period of time T_vbr may be about 1 minute, the presentinvention is by no means limited thereto.

The reference value is determined by taking the relationship of thecoding difficulty level, the amount of allocated coding bits and theamount of actually generated bits of a preceding unit time and also therelationship of the coding difficulty level of the preceding unit timeand that of the current unit time into consideration.

It is determined in advance that the amount of the upper limitcorresponding to the amount of allocated bits b_av per unit time isgiven when allocating an amount of bits exceeding the above b_real andthe amount of the lower limit corresponding to the amount of allocatedbits b_av per unit time is given when allocating an amount of bits shortof the above b_real.

Additionally, the video signal of images whose degradation due to codingcan become conspicuous is provided with a lower limit for the amount ofallocated bits corresponding to the possible degree of degradation,taking the visual characteristics of human being into consideration.

If the difference between the sum of the amounts of actually generatedbits B_gene in the period of time and the sum of the amounts ofavailable bits B_av in the period of time (B_av−B_gene) is positive whenthe coding operation in said period of time T_vbr is over, thedifference is carried over and added to the sum of the amounts ofavailable bits in the next period of time. If the sum of the amounts ofavailable bits exceeds R_total times of the initial sum B_av as a resultof carrying over the difference, the reference value of the actuallyallocated bits per unit time b_real is raised as a function of theratio.

Now, the algorithm for determining the amount of allocated bits of thecoding difficulty level computation circuit 33 and the amount ofallocated bits computation circuit/controller 34 of FIG. 5 will bedescribed by referring to the flow charts of FIGS. 6 through 12.

Referring firmly to FIG. 6, the processing operation for determining theamount of allocated bits starts in Step S50 and then the codingdifficulty level computation circuit 33 inputs the moving image in StepS51 and initializes the reference value of coding difficulty level d_Avgby using initial value d_Default in Step S52.

Then, in Step S53, the reference bit rate b_real when the variable bitrate is controlled is determined from the average amount of allocatedbits b_av per unit time input from the terminal 30 of FIG. 5 by usingformulab_real=b _(—) av×R _(—) vbr [Mbps].Note that the ratio of the reference bit rate when the variable bit rateis controlled, or R_vbr is defined by 0<R_vbr<1. For instance, a valueof R_vbr=0.9 may be used. The time period of 1 GOP (group of pictures)according to MPEG may typically used for the unit time.

In Step S54, virtual buffer V_vbr for controlling the variable bit rateis secured for the time when the control of the variable bit rate forthe period of time T_vbr is started by using the formula below. If thetemporally preceding coding operation has any residue in V_vbr, theresidue is carried over to the succeeding period of time T_vbr.V _(—) vbr=V _(—) vbr+(1−R _(—) vbr)×T _(—) vbr×b _(—) av [Mbit]By utilizing the virtual buffer V_vbr, an amount of information greaterthan b_real is allocated to an image showing a relatively high codingdifficulty level, whereas an amount of information smaller than b_realis allocated to an image showing a relatively low coding difficultylevel.

Now, the concept of virtual buffer will be described by referring toFIG. 13. In FIG. 13, part of the sum B_av (=b_av×T_vbr) of the amountsof allocated bits per unit time obtained for the time period T_vbr isstored in advance as virtual buffer V_vbr. If the amount of bits perunit time of the virtual buffer is v_vbr, V_vbr=v_vbr×T_vbr.Additionally, the reference value b_real of the amount of actuallyallocated bits per unit time is expressed by b_real=(B_av−V_vbr)/T_vbr.For the time period T_vbr, a value of T_vbr=1 [min] may typically beused.

In Step S55, the coding difficulty level d of the unit time for whichthe image signal is being coded currently and the visual characteristicsR_visual are input to the amount of allocated bits computationcircuit/controller 34 for each unit time.

The parameters that can be used for estimating the coding difficultylevel d per unit time may include the prediction error of the unit timepreceding the above unit time ME_error, the motion vector MV, the indexindicating the deviation of the brightness value activity, the amount ofgenerated information b_gene and the Q scale q_scale.

The coding difficulty level computation circuit 33 estimates the codingdifficulty level d, using the formula below.d=ME_error×W _(—) ME+MV×W _(—) MV+activity×W _(—)AC+b_gene×W_GENE+q_scale×W _(—) Q,where

-   W_ME:weight to the motion prediction error,-   W_MV:weight to the motion vector,-   W_AC:weight to the deviation of the brightness value-   W_GENE:weight to the amount of generated bits and-   W_Q:weight to the Q scale.

In Step S56, the input coding difficulty level d is corrected. This is aprocessing operation for limiting the coding difficulty level d by meansof the upper limit value d_Max and the lower limit value d_Min. FIG. 7is a flow chart illustrating the operation in detail.

Referring to FIG. 7, the operation of correcting the coding difficultylevel is started in Step S70 and, if it is found in Step S71 that theestimated coding difficulty level exceeds the upper limit value d_Max ofcoding difficulty level, the coding difficulty level of the unit time isdetermined to be equal to d_Max in Step S73. If, on the other hand, itis found in Step S72 that the estimated coding difficulty level issmaller than the lower limit value d_Min of coding difficulty level, thecoding difficulty level of the unit time is determined to be equal tod_Min in Step S74. In other words,if (d>d_Max), d=d_Max;if (d<d_Min), d=d_Min;After Steps S72, S73 and S74, the operation of correcting the codingdifficulty level ends in Step S75.

Now, returning to FIG. 6, the amount of allocated bits b_x is determinedin Step S57 by using the reference value of amount of allocated bitsb_real, the coding difficulty level d and the reference value of codingdifficulty level d_Avg. In other words,b _(—) x=b_real×d/d_Avg [Mbps]

In Step S58, the lower limit of amount of allocated bits b_Min isregulated or corrected according to the visual characteristic valueR_visual because the perceived degradation of image quality due to thecoding operation can vary depending on the visual characteristics of theinput image. FIG. 8 shows a flow chart of the operation of Step S58.

Referring to FIG. 8, the operation of correcting the visualcharacteristic value starts in Step S80 and, if it is found in Step S81that the visual characteristic value R_visual of the input image isgreater than a predetermined value Th_visual, the lower limit b_Min ofamount of allocated bits is corrected by using the formula below in StepS82. That is,if (R_visual>Th_visual)b_Min=b_Min×(1−Th_visual+R_visual);

If it is found in Step S83 that the corrected lower limit value b_Min ofamount of allocated bits exceeds the upper limit value b_Max of amountof allocated bits, the lower limit value b_Min is made to be equal toupper limit value b_Max of amount of allocated bits in Step S84. Inother words,if (b_Min>b_Max), b_Min=b_Max;The visual characteristic value as used herein may refer to the ratio ofthe skin color or the intermediary tones in the input image and beexpressed in terms of 0<Th_visual<1 and 0<R_visual<1. Since Th_visualrepresents a constant value, it may typically be made equal to 0.5.After Steps S81 and S84, the operation of correcting the visualcharacteristic value ends in Step S85.

Returning again to FIG. 6, in Step S59, the amount of allocated bits perunit time determined in Step S57 is corrected by referring to the upperlimit value b_Max and the lower limit value b_Min of amount of allocatedbits that are predetermined. FIG. 9 is a detailed flow chart of theoperation of correcting the amount of allocated bits.

Referring to FIG. 9, the operation of correcting the amount of allocatedbits starts in Step S90 and, if it is found in Step S91 that the amountof allocated bits b_x exceeds the upper limit value b_Max of amount ofallocated bits, the amount of allocated bits is made equal to b_Max inStep S93. If, on the other hand, it is found in Step S92 that the amountof allocated bits b_x is lower than the lower limit value b_Min ofamount of allocated bits, the amount of allocated bits is made equal tob_Min in Step S94. In other words,if (b_x>b_Max), b_x=b_Max;if (b_x<b_Min), b_x=b_Min;The following values may typically be used respectively for the upperlimit value b_Max of amount of allocated bits and the lower limit valueof b_Min of amount of allocated bits;b_Max=2.0 b_real, and b_Min=0.5 b_real;After Steps S92, S93 and S94, the operation of correcting the amount ofallocated bits ends in Step S95.

Now back to FIG. 6, the amount of allocated bits is corrected in StepS60 on the basis of the predetermined absolute rating for the codingdifficulty level. FIG. 10 is a detailed flow chart of the operation ofcorrecting the absolute amount of bits.

Referring to FIG. 10, the operation of correcting the absolute amount ofbits starts in Step S100 and then, if it is determined in Step S101 thatthe estimated coding difficulty level d exceeds the upper limit ofabsolute value of coding difficulty level d_High and the amount ofallocated bits b_x falls below the lower limit of absolute value ofamount of allocated bits b_Low, the amount of allocated bits is madeequal to b_Low in Step S103. If, on the other hand, it is determined inStep S102 that the estimated coding difficulty level d falls under thelower limit of absolute value of coding difficulty level d_Lowh and theamount of allocated bits b_x exceeds the upper limit of absolute valueof amount of allocated bits b_High, the amount of allocated bits is madeequal to b_High in Step S 104. In other words,if (d>d_High && b_x<b_Low)b_x=b_Low;if (d<d_Low && b_x>b_High)b_x=b_High;The following values may typically be used respectively for the lowerlimit of absolute value of amount of allocated bits b_Low and the upperlimit of absolute value of amount of allocated bits b_High;b_Low=1.2 b_real, b_High=0.8 b_real;After Steps S102, S103 and S104, the operation of correcting the amountof allocated bits ends in Step S105.

Referring back to FIG. 6 at step S61, the reference value of codingdifficulty level d⁻Avg is updated according to the reaction speedReactor, using the coding difficulty level d of the current unit time.In other words,d_Avg=(d_Avg×(1−Reactor)+d×Reactor)where the reaction speed Reactor is 0<Reactor<1 and may typically be0.5.

In Step S62, if there is a scene change, a processing operation for thescene change is conducted. FIG. 11 illustrates a detailed flow chart ofthe operation for processing a scene change.

Referring to FIG. 11, the operation of processing a scene change startsin Step S110 and, if a scene change is detected in Step S111, thereference value of coding difficulty level d_Avg is initialized byinitial value d_Default. If it is found in Step S113 that the amount ofinformation necessary for the virtual buffer V_vbr is left, theallocated bit rate is corrected in Step S114 according to the ratio ofthe allocated bit rate R_SC immediately after the scene change. Thisprocessing operation can be expressed as follows;

if (scene_change) { d_Avg = d_Default; if(V_vbr > (R_SC −1) × b_vbr ×0.5) { b_x = b_av × R_SC; } }where the ratio of the allocated bit rate R_SC is 1>R_SC and maytypically be R_SC=1.5. After Steps S111, S113, S114, the operation ofprocessing the scene change ends in Step S115.

Then, in Step S63 of FIG. 6, a processing operation relating to thevirtual buffer V_vbr is carried out. FIG. 12 illustrates a detailed flowchart of the operation of processing the virtual buffer.

Referring to FIG. 12, the operation of processing the virtual bufferstarts in Step S120 and, if it is found in Step S121 that the residue ofvirtual buffer V_vbr is less than 0 and the amount of allocated bits b_xis less than the reference value of amount of allocated bits b_real, theoperation proceeds to Step S125, where the amount of allocated bits b_xis made equal to the reference value of amount of allocated bits b_real.In other words,if (V_vbr<0 && b_x>b_real)b_x=b_real;

Then, if it is found in Step S122 that the virtual buffer V_vbr exceedsthe predetermined upper limit value of virtual buffer V_Max, the amountof allocated bits b_x is corrected in Step S123 by using the followingformula.

if (V_vbr > V_Max) { b_x = V_vbr / V_Max × b_x; }The upper limit value of virtual buffer V_Max may typically be expressedbyV_Max=2.0 V_vbr;

Then, in Step S124, the difference between the amount of allocated bitsb_x and the reference value of amount of allocated bits b_real issubtracted from the residue of virtual buffer V_vbr to update theresidue of virtual buffer V_vbr. After Steps S125, S124, the operationof processing the virtual buffer ends in Step S126.

Referring again back to FIG. 6, if it is found in Step S64 that the unittime (GOP) for which the processing operation is being conducted is thelast unit time of the period of time T_vbr, the operation proceeds toStep S63. Otherwise, the operation returns to Step S55, where theprocessing operation for the next unit time starts. If it is found inStep S65 that the unit time is the last one for the processing sequence,the operation proceeds to Step S66, where the processing operation ends.Otherwise, the operation returns to Step S55, where the virtual bufferV_vbr is supplemented and the processing operation for the next periodof time T_vbr starts.

Now, a signal recording/reproduction apparatus to which this embodimentcan be applied will be described in detail by referring to FIG. 14. Theapparatus of FIG. 14 is adapted to use a hard disk as recording medium.

Referring to FIG. 14, the television broadcast signal received typicallyby means of an antenna is transmitted to a tuner 1, which may be aterrestrial wave tuner, by way of input terminal 101. The video outputand the audio output of the tuner 1 are then fed to an input switchcircuit 2. Similarly, the composite video signal and the audio signalfrom an external source are also fed to the input switch circuit 2 viathe input terminal 102 and input terminal 103 respectively. The inputswitch circuit 2 select the desired signals according to the instructionfrom system controller 16. The composite video signal is output to Y/Cseparation circuit 3, while the audio signal is output to audio A/Dconverter 10.

The system controller 16 controls all the component blocks of theapparatus, which will be described hereinafter. Additionally, ifnecessary, the system controller 16 accesses and controls ROM (read onlymemory) 17 and/or RAM (random access memory) 18.

The Y/C separation circuit 3 separates the Y (luminance) signal and theC (chroma) signal out of the composite video signal it receives,generates an elementary stream (ES) of the image and feeds them to inputswitch 4. The input switch 4 selects either the signal from external Svideo input terminal 104 or the output of the Y/C separation circuit 3and feeds the selected signal to NTSC decoder circuit 5.

The video signal input to the NTSC decoder 5 is subjected to A/Dconversion, chroma encoding and other operations and converted into adigital component video signal (to be referred to as video datahereinafter), which is then fed to pre-processing (pre-video signalprocessing) circuit 7. Additionally, the NTSC decoder 5 supplies theclock generated by referring to the horizontal synchronizing signal ofthe input video signal and the horizontal synchronizing signal, thevertical synchronizing signal and the field discriminant signal obtainedby sync separation to sync control circuit 6.

The sync control circuit 6 generates a clock and a sync signal adaptedto the timings required for the blocks as will be described hereinafterand supplies them to each of the blocks.

The pre-processing (pre-video signal processing) circuit 7 performsvarious video signal processing operations such as pre-filtering andnoise reduction on the input video data and supplies the processedsignal typically to MPEG (moving picture experts group) encoder 8 andpost-processing (post-video signal processing) circuit 20.

The MPEG encoder 8 performs various coding operations such as blockdetection (discrete cosine transform) on the video data from thepre-processing circuit 7, generates an elementary stream (ES) of theimage and supplies the coded signal to multiplexer/demultiplexer 9.While the MPEG compression system is used in this embodiment, some othercompression system may alternatively be used for the purpose of theinvention. Furthermore, the signal may not necessarily be compressed.

On the other hand, the audio signal selected by the input switch circuit2 is converted into a digital audio signal by the audio A/D converter 10and then fed to audio encoder 11 which may typically be an MPEG audioencoder. The signal is then compressed by the MPEG audio encoderaccording to the MPEG format and subsequently an ES is generated so thatthe signal and the ES are supplied to the multiplexer/demultiplexer 9 asin the case of video signal. As for audio signals, while the MPEGcompression system is used in this embodiment, some other compressionsystem may alternatively be used for the purpose of the invention.Furthermore, the signal may not necessarily be compressed.

For a recording operation, the multiplexer/demultiplexer 9 multiplexesthe video ES (elementary stream), the audio ES and the various controlsignals. For a reproducing operation, it separates the transport stream(TS). The multiplexer/demultiplexer multiplexes the MPEG video ES(elementary stream), the MPEG audio ES and the various control signalsand typically generates a TS of the MPEG system. Then, it feeds them tobuffer control circuit 14.

The buffer control circuit 14 controls the operation of intermittentlytransmitting the TS that is input continuously to downstream hard diskdrive (HDD) 15. For example, since the HDD (hard disk drive) 15 is notavailable for writing the TS signal when it is seeking data, the TSsignal is temporarily stored in a buffer. On the other hand, when theHDD 15 is available for writing the TS signal, the latter is written ata rate higher than the rate at which it is input so that the input TSsignal that is input continuously can be recorded without any omission.

The HDD 15 records the TS signal at predetermined addresses under thecontrol of the system controller 16.

While IDE (intelligent drive electronics) is used as protocol for thebuffer control circuit 14 and the HDD 15 in this embodiment, the presentinvention is by no means limited thereto. Similarly, while thisembodiment is described above by referring to an HDD as recordingmedium, it may be replaced by an optical disk, a magneto-optical disk ora solid memory without any problem.

Now, the signal reproducing operation of the embodiment will bedescribed below.

The HDD 15 seeks predetermined addresses to read the TS (transportstream) signal and supplies it to the buffer control circuit 14 underthe control of the system controller 16. The buffer control circuit 14controls the buffer so as to turn the signal that is inputintermittently into a continuous signal and feeds the TS signal tomultiplexer/demultiplexer 9. The multiplexer/demultiplexer 9 extractsthe PES (packetized elementary stream) out of the time stamp and feedsit to AV. (audio/video) decoder 19, which may typically be an MPEG AVdecoder.

The MPEG AV decoder 19 separates the video ES and the audio ES of theinput PES and feeds them respectively to the video MPEG decoder and theaudio MPEG decoder for decoding. As a result of this processingoperation, video data and the audio data of base band are obtained andfed to post-processing (post-video signal processing) circuit 20 andswitch 23.

The post-processing circuit performs operations such as selecting thevideo data from the pre-processing (pre-video signal processing) circuit7, synthetically combining signals and/or filtering signals and suppliesthe obtained video data to OSD (on screen display) circuit 21.

The OSD circuit 21 generates graphics to be displayed on the displayscreen and performs other operations such as superimposing them on videodata or displaying them in part of the screen. The obtained video dataare then fed to the NTSC encoder 22.

The NTSC encoder 22 converts the input video data (component digitalsignal) into a YC (luminance, chroma signal), which is then subjected toD/A conversion to produce an analog composite video signal and an Svideo signal, which composite video signal and S video signal are thentaken out externally by way of output terminal 106 and output terminal107 respectively.

Meanwhile, the switch 23 selects either the audio data fed from the MPEGAV decoder 19 or the audio data input from the audio A/D converter 10 sothat the selected signal is converted into an analog audio signal byaudio A/D converter 24. The analog audio signal from the audio A/Dconverter 24 is then taken out externally by way of output terminal 108.

Now, the digital signal that is fed and output by way of digital IN/OUTterminal 105 will be described below. When, for example, recording asignal input from an external IRD (integrated receiver decoder) by wayof a digital interface such as one conforming to IEEE1394, the digitalsignal is input to digital interface circuit 12.

The digital interface circuit 12 performs processing operations such asformat conversion to make the signal conform to the current system andgenerates a TS, which is then fed to multiplexer/demultiplexer 9. Themultiplexer/demultiplexer 9 analyses and generates a control signalalong with other signals and converts the TS into a signal conforming tothe current system, which is then fed to the downstream of theapparatus. All the subsequent processing operations are same as thosedescribed above for a video data and an audio data. At the same time,the multiplexer/demultiplexer 9 separates the components of the digitalsignal and supplies the obtained PES to the MPEG AV decoder 19 to obtainan analog video signal and an analog audio signal.

The signal reproducing operation of the digital interface circuit 12will be described below. The operation down to themultiplexer/demultiplexer 9 is same as the one described above and hencewill not be described any further.

Upon receiving the TS signal and if necessary, themultiplexer/demultiplexer 9 analyses and generates a control signal andsupplies it to the digital interface circuit 12. The digital interfacecircuit 12 performs a converting operation that is opposite to the oneit performs for recording to produce a digital signal conforming to anexternal IRD, which digital signal is then output by way of digitalIN/OUT terminal 105. At the same time, the multiplexer/demultiplexer 9performs a processing operation for separation and supplies the PES tothe MPEG AV decoder 19 to produce an analog video signal and an analogaudio signal. While this embodiment is described in terms of connectionto an IRD, it can alternatively be connected to an AV apparatus such asTV set or a personal computer.

While the signal recording medium of FIG. 14 is described above in termsof a hard disk, it may be replaced by any appropriate signal recordingmedium such as an optical disk, a flexible disk, a magnetic recordingmedium such as magnetic tape, a semiconductor recording medium such asIC cards or some other memory for recording the signal coded by thisembodiment. Optical disks that can be used with an encoder according tothe invention include those adapted to record signals on a bit by bitbasis and magneto-optical disks along with phase-change type opticaldisks, organic coloring matter type optical disks, optical disks adaptedto be used with an ultraviolet laser beam for recording and opticaldisks having a multilayer recording film.

1. A video signal coding method comprising the steps of: determining acoding difficulty level d of an input video signal for each unit oftime; measuring visual characteristics of the input video signal;determining a reference value for allocating coding bits on the basis oftemporally b (d) for the amount of coding bits b allocated for each unitof time and related in advance to the coding difficulty level d of saidinput video signal for each unit of time; determining an actual amountof allocated coding bits b x on the basis of the reference value; andgenerating coded data by coding the input video signal for each unit oftime on the basis of said actual amount of allocated coding bits b x,wherein part of the sum B_av of the amounts of allocated bits b_av perunit time for a certain period of time T_vbr, orB_av=b_av×T_vbr, is stored as virtual buffer V_vbr in advance and theactual reference value of the amount of allocated coding bits b_real isobtained byb_real=(B _(—) av−V _(—) vbr)/T _(—) vbr so that an amount of allocatedbits not smaller than b_real is given as long as V_vbr>0 but an amountsmaller than b_real is given otherwise in said step of determining theactual amount of allocated coding bits on the basis of said referencevalue.
 2. The video signal coding method according to claim 1, whereinan upper limit is provided in advance according to the amount ofallocated bits b_av when giving an amount of allocated bits exceedingsaid b_real.
 3. The video signal coding method according to claim 1,wherein a lower limit is provided in advance according to the amount ofallocated bits b_av when giving an amount of allocated bits smaller thansaid b_real.
 4. The video signal coding method according to claim 1,wherein the upper limit is provided according to a proportion of scenesthat are conspicuously degraded as a result of coding by taking thevisual characteristics of the input image into consideration when givingan amount of allocated bits smaller than said b_real.
 5. The videosignal coding method according to claim 1, wherein, when the differencebetween the sum of the amounts of actually generated bits B_gene in theperiod of time and the sum of the amounts of available bits B_av in theperiod of time (B_av−B_gene) is positive when the coding operation insaid period of time T_vbr is over, the difference is carried over andadded to the sum of the amounts of available bits in the next period oftime.
 6. The video signal coding method according to claim 1, wherein,when the sum of the amounts of available bits exceeds R_total times ofthe initial sum B_av as a result of carrying over the difference, thereference value of the actually allocated bits per unit time b_real israised according to the ratio.
 7. A video signal encoder comprising: ameans for determining a coding difficulty level d of an input videosignal for each unit of time; a means for measuring visualcharacteristics of the input video signal; a means for determining areference value for allocating coding bits on the basis of temporally b(d) for an amount of coding bits b allocated for each unit of time andrelated in advance to the coding difficulty level d of said input videosignal for each unit of time; a means for determining an actual amountof allocated coding bits b x on the basis of the reference value; and ameans for generating coded data by coding the input video signal foreach unit of time on the basis of said actual amount of allocated codingbits b x, wherein said means for determining the actual amount codingbits on the basis of the reference value controls the actual amount ofallocated bits in such a way that the sum of the generated bits obtainedwhen coding the input video signal for a certain period of time T_vbrdoes not exceed the amount of bits available for recording a signalhaving the length of the period of time T_vbr on a recording medium. 8.A video signal encoder comprising: a means for determining a codingdifficulty level d of an input video signal for each unit of time; ameans for measuring visual characteristics of the input video signal; ameans for determining a reference value for allocating coding bits onthe basis of temporally b (d) for an amount of coding bits b allocatedfor each unit of time and related in advance to the coding difficultylevel d of said input video signal for each unit of time; a means fordetermining an actual amount of allocated coding bits b_x on the basisof the reference value; and a means for generating coded data by codingthe input video signal for each unit of time on the basis of said actualamount of allocated coding bits b_x, wherein part of the sum B_av of theamounts of allocated bits bay per unit time for a certain period of timeT_vbr, orB_av=b_av×T_vbr, is stored as virtual buffer V_vbr in advance and theactual reference value of the amount of allocated coding bits b_real isobtained byb_real=(B _(—) av−V _(—) vbr)/T _(—) vbr so that an amount of allocatedbits not smaller than b_real is given as long as V_vbr>0 but an amountsmaller than b_real is given otherwise in said step of determining theactual amount of allocated coding bits on the basis of said referencevalue.
 9. The video signal encoder according to claim 8, wherein anupper limit is provided in advance according to the amount of allocatedbits b_av when giving an amount of allocated bits exceeding said b_real.10. The video signal encoder according to claim 8, wherein a lower limitis provided in advance according to the amount of allocated bits b_avwhen giving an amount of allocated bits smaller than said b_real. 11.The video signal encoder according to claim 8, wherein the lower limitis determined as according to a proportion of scenes that areconspicuously degraded as a result of coding by taking the visualcharacteristics of the input image into consideration when giving anamount of allocated bits smaller than said b_real.
 12. The video signalencoder according to claim 8, wherein, when the difference between thesum of the amounts of actually generated bits B_gene in the period oftime and the sum of the amounts of available bits B_av in the period oftime (B_av−B_gene) is positive when the coding operation in said periodof time T_vbr is over, the difference is carried over and added to thesum of the amounts of available bits in the next period of time.
 13. Thevideo signal encoder according to claim 8, wherein, when the sum of theamounts of available bits exceeds R_total times of the initial sum B_avas a result of carrying over the difference, the reference value of theactually allocated bits per unit time b_real is raised according to theratio.
 14. A video signal coding method comprising the steps of:utilizing a virtual buffer; allocating an amount of information greaterthan b_real to an image showing a relatively high coding difficultylevel where b_real is obtained byb_real=(B _(—) av)×(R _(—) vbr); and controlling a bit rate based on anamount of residue, where the amount of residue is obtained by(b_real−b_av)×(T_vbr); wherein an amount of information smaller thanb_real is allocated to an image showing a relatively low codingdifficulty level.